<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>修改会员等级 </title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="汽车租赁">
</head>
<body>
	<article class="page-container">
	<form class="form form-horizontal" id="form-grade-add">
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>级别名称：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" placeholder="级别名称" placeholder="" value="${memberLevel.levelName}" id="levelName" name="levelName"/>
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>最小信用：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" placeholder="最小信用" id="minScore" name="minScore" value="${memberLevel.minScore}"/>
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>最大信用：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="${memberLevel.maxScore}" placeholder="最大信用" id="maxScore" name="maxScore">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>租车折扣：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" placeholder="租车折扣" name="discount" id="discount" value="${memberLevel.discount}"/>
		</div>
	</div>
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
		</div>
	</div>
	</form>
</article>
	
<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 
<script type="text/javascript">
	$(function(){
		$("#form-grade-add").validate({
		rules:{
			levelName:{
				required:true,
			},
			minScore:{
				required:true,
				digits:true
			},
			maxScore:{
				required:true,
				digits:true
			},
			discount:{
				required:true,
				number:true
			}
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			
	   		$.ajax({
	            type: 'put', 
				contentType:"application/json", 
	            url: '/editgrade/${memberLevel.levelId}', 
	            data:JSON.stringify({
		                'levelName': $("#levelName").val(),
		                'minScore': $("#minScore").val(),
		                'maxScore': $("#maxScore").val(),
		                'discount': $("#discount").val()
						}),
	            success:function(data){ 
					alert("修改成功");
	 				console.log('提交成功！');
	 				var index = parent.layer.getFrameIndex(window.name);
					//parent.$(".btn-primary").click();
					parent.layer.close(index);
	            }
	
	        });

			
		}
	});
	});
	
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>